window.onload = startup;

function $(id) {
	try {
		return document.getElementById(id);
	} catch (e) {
		return null;
	}
}

var g = 1;

function startup() {
	var il = $("logo_l");
	var ir = $("logo_r");
	il.style.left = "-400px";
	ir.style.left = "400px";
	window.setTimeout(function() {
		moveclose(il, ir);
	}, 500);
}

function moveclose(il, ir) {
	var ll = il.style.left;
	ll = ll.replace("px", "") * 1 + g;
	il.style.left = ll + "px";
	var rl = ir.style.left;
	rl = rl.replace("px", "") * 1 - g;
	ir.style.left = rl + "px";
	if (rl > 0) {
		g = g * 1.07;
		window.setTimeout(function() {
			moveclose(il, ir);
		}, 15);
	} else {
		pop(il, ir);
	}
}

function pop(il, ir) {
	if (g > 1) {
		var ll = il.style.left;
		ll = ll.replace("px", "") * 1 - g;
		il.style.left = ll + "px";
		g = g / 1.1;
		window.setTimeout(function() {
			pop(il, ir);
		}, 15);
	} else {
		chase(il, ir);
	}
}

function chase(il, ir) {
	if (g < 25) {
		var rl = ir.style.left;
		rl = rl.replace("px", "") * 1 - g;
		ir.style.left = rl + "px";
		g=g*1.07;
		window.setTimeout(function() {
			chase(il, ir);
		}, 15);
	}
}